#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

char buf[128] = { 0 };
int main(int argc, const char* argv[])
{
    int fd;
    if ((fd = open("/dev/myled0", O_RDWR)) < 0) {
        perror("open error");
        exit(EXIT_FAILURE);
    }

    write(fd, buf, sizeof(buf));
 sleep(10);
    read(fd, buf, sizeof(buf));

    close(fd);
    return 0;
}